package StudyCode.summary.myfile;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.GroupPrincipal;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class GetGroupPrincipal {
	public static void main(String[] args) {

		Path path = Paths.get("E:\\迅雷下载\\test1.txt");
		try {
			GroupPrincipal group = (GroupPrincipal) Files.getAttribute(path, "posix:group", LinkOption.NOFOLLOW_LINKS);
			System.out.println(group.getName());
		} catch (IOException e) {
			System.err.println(e);
		}

	}
}
